﻿Public Class ControlAlumno
    Dim _acceso As New AccesoBD

    Private Sub buscarAlumnoLegajo(ByVal legajo As Integer)
        Dim consulta As String
        Dim tabla As New DataTable

        consulta = "select apellido + ', ' + nombre from alumnos where legajoAlumno = " & legajo
        tabla = _acceso.ejecutaSQL(consulta)
        Me.txtAlumno.Text = tabla.Rows(0)(0)
    End Sub

    
    Private Sub txtBuscaAlumno_KeyDown(ByVal sender As System.Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles txtBuscaAlumno.KeyDown
        If e.KeyCode = Keys.Enter Then
            buscarAlumnoLegajo(Me.txtBuscaAlumno.Text)
        End If
    End Sub
End Class
